package com.carful.xigua.modules.common.util;

import org.springframework.stereotype.Component;

import java.util.HashSet;
import java.util.Set;

@Component
public class JwtTokenBlacklist {

    private final Set<String> blacklist = new HashSet<>();

    synchronized public void  addTokenToBlacklist(String token) {
        blacklist.add(token);
    }

    synchronized public boolean isTokenBlacklisted(String token) {
        return blacklist.contains(token);
    }
}